<template>父传递 ： {{ toy }}</template>

<script setup lang="ts">
import emitter from "@/utils/emitter";
import { onUnmounted, ref } from "vue";
let toy = ref("");
emitter.on("send-toy", (res: any) => {
  toy.value = res;
});
onUnmounted(() => {
  emitter.off("send-toy");
});
</script>

<style lang="scss" scoped></style>
